package root.loan;

import exceptions.HasAlreadyDoneException;


/**
 * 
 * State em que o emprestimo eh cancelado pelo dono e o item eh devolvido para ele
 *
 */
public class CanceledReturned extends Canceled {

	private final String descricao = "Cancelado";
	
	@Override
	public String getDescricao() {
		return descricao;
	}
	
	@Override
	public void returnItem(Borrow borrow) throws HasAlreadyDoneException {
		throw new HasAlreadyDoneException("Item já devolvido");
	}
	
	@Override
	public void requestDevolution(Borrow borrow) throws HasAlreadyDoneException {
		throw new HasAlreadyDoneException("Item já devolvido");
	}
	
	@Override
	public void complete(Borrow borrow) throws HasAlreadyDoneException {
		mudaEstado(borrow,new CanceledComplete());
	}
	
	@Override
	public void cancel(Borrow borrow) throws HasAlreadyDoneException {
		throw new HasAlreadyDoneException("Item já devolvido");
	}
}
